package com.ssy.lingxi.contract.model.constant;

import java.util.Arrays;

/**
 * 请款单数据来源
 * @author ds
 * @date 2021/4/23
 * @version 2.0.0
 */
public enum ApplyAmountOrderSourceTypeEnum {

    /**
     * 全部 - 0
     */
    ALL(0, "全部"),
    /**
     * 付款计划 - 1
     */
    PAY_PLAN(1, "付款计划"),
    /**
     * 合同执行 - 2
     */
    CONTRACT_EXECUTE(2, "合同执行"),
    /**
     * 手工 -3
     */
    MANUAL(3, "手工"),
    ;
    private final Integer code;
    private final String message;
    ApplyAmountOrderSourceTypeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessage(Integer code) {
        ApplyAmountOrderSourceTypeEnum item = Arrays.stream(ApplyAmountOrderSourceTypeEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);

        return null != item ? item.getMessage() : "";
    }
}
